import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
  },
  getters: {
  },
  mutations: {
    saveUser(state, payload) {
      state.nikename = payload;
      // 将用户名存入storage
      sessionStorage.setItem('name', payload);
    },
    outLogin(state) {
      state.nickname = null;
      sessionStorage.removeItem('name');
    },
  },
  actions: {
  },
  modules: {
  }
})
